import java.util.Arrays;

/**
 * 购买两块巧克力
 *
 * @USER: Administrator
 * @DATE: 2024/9/29 上午12:24
 * @VERSION: 1.0.0
 */
public class LC2706 {
    public static void main(String[] args) {

    }

    public int buyChoco(int[] prices, int money) {
        Arrays.sort(prices);
        return money-prices[0]-prices[1]<0?money:money-prices[0]-prices[1];
    }

}
